package com.fay.learn.controller;

import com.fay.learn.config.TestConfig;
import com.fay.learn.server.TestConfigServe;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author fay
 * @date 2021-01-29
 */
@RestController
public class TestController {
    @Resource
    private TestConfig testConfig;
    @Resource
    private TestConfigServe testConfigServe;

    @GetMapping("/getName")
    public String getName() {
        System.out.println(testConfig.getId());
        return testConfig.getName();
    }

    @GetMapping("/print")
    public String print() {
        String print = testConfigServe.print();
        System.out.println(print);
        return print;
    }
}
